/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SetScaleDialog.java
 *
 * Created on 2011-07-11, 21:32:26
 */
package JFreeChartExtensions.ChartPanelDialogs;

import JFreeChartExtensions.chartextensions.utils.XYTitleAnnotationWrapper;
import JFreeChartExtensions.ExtendableChartPanel;
import JFreeChartExtensions.utils.Helper;
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
import java.util.HashMap;
import java.util.Map;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import org.jfree.chart.title.LegendTitle;
import org.jfree.ui.RectangleEdge;
import org.jfree.chart.annotations.XYTitleAnnotation;

/**
 *
 * @author Nobody
 */
public class LegendPropertiesDialog extends ChartPanelDialog{

    private XYTitleAnnotationWrapper annotationWrapper;
    private Map<String, RectangleEdge> outsidePositionBindings = new HashMap<String, RectangleEdge>();
    private HashMap<String, Rectangle2D.Double> insidePositionBinding = new HashMap<String, Rectangle2D.Double>();

    public LegendPropertiesDialog(ExtendableChartPanel chart) {
        super(chart);
        initComponents();
      
        outsidePositionBindings.put(" Top", RectangleEdge.TOP);
        outsidePositionBindings.put(" Left", RectangleEdge.LEFT);
        outsidePositionBindings.put(" Right", RectangleEdge.RIGHT);
        outsidePositionBindings.put(" Bottom", RectangleEdge.BOTTOM);

        insidePositionBinding.put(" Left top corner", new Rectangle.Double(0.1, 0.95, 0.5, 0.5));
        insidePositionBinding.put(" Right top corner", new Rectangle.Double(0.75, 0.95, 0.5, 0.5));
        insidePositionBinding.put(" Left bottom corner", new Rectangle.Double(0.1, 0.05, 0.5, 0.5));
        insidePositionBinding.put(" Right bottom corner", new Rectangle.Double(0.75, 0.05, 0.5, 0.5));



        annotationWrapper = new XYTitleAnnotationWrapper(this.parentPanel.getChart());
        annotationWrapper.setLastUsedRect(new Rectangle.Double(0.1, 0.95, 0.5, 0.5));
        fillControlsWithValues();
    }

    private void fillControlsWithValues() {
        LegendTitle legend = parentPanel.getChart().getLegend();
        VisibleCheckBox.setSelected(legend.isVisible() || annotationWrapper.isVisible());
        InsidePlotCheckBox.setSelected(annotationWrapper.isVisible());
        fillPositionComboBoxRegardingInsidePlotSelection();
        LegendTitle legendTitle = parentPanel.getChart().getLegend();
        VisibleCheckBox.setSelected(legendTitle.isVisible() || annotationWrapper.isVisible());
        InsidePlotCheckBox.setSelected(annotationWrapper.isVisible());
    }

    private void updateComponentsRegardingInsidePlotSelection() {
        fillPositionComboBoxRegardingInsidePlotSelection();
        setEnabledCustomPositionRegardingInsidePlotSelection();
    }

    private void setEnabledCustomPositionRegardingInsidePlotSelection() {
        CustomPositionCheckBox.setEnabled(InsidePlotCheckBox.isSelected());
        CustomPositionCheckBox.setSelected(false);
        CustomPositionCheckBox.updateUI();
        LegendTitle legendTitle = parentPanel.getChart().getLegend();
        if (!InsidePlotCheckBox.isSelected()) {
            Helper.getHelper().disablePanel(CurrentPositionPanel);
            PosistionCheckBox.setEnabled(true);
            PosistionCheckBox.updateUI();
            legendTitle.setVisible(true);
            annotationWrapper.setVisible(false);
        } else {
            legendTitle.setVisible(false);

            Rectangle2D.Double rect = insidePositionBinding.get(PosistionCheckBox.getSelectedItem());
            if(parentPanel.hasLogarithmicsXScale() || parentPanel.hasLogarithmicsYScale()) {
                if(rect.x > 0.5)
                    rect.x -= 0.15;
                else
                    rect.x += 0.15;
                if(rect.y > 0.5)
                    rect.y -= 0.1;
                else
                    rect.y += 0.1;
            }
            annotationWrapper.setLastUsedRect(rect);
            annotationWrapper.setVisible(true);

        }

    }

    private void fillPositionComboBoxRegardingInsidePlotSelection() {
        DefaultComboBoxModel model = (DefaultComboBoxModel) PosistionCheckBox.getModel();
        model.removeAllElements();
        if (InsidePlotCheckBox.isSelected()) {
            fillModelWithValues(insidePositionBinding, model);

            boolean founded = false;
            XYTitleAnnotation xYTitleAnnotation = annotationWrapper.getAnnotation();
            if (xYTitleAnnotation != null) {
                Rectangle2D.Double rect = new Rectangle2D.Double(xYTitleAnnotation.getX(), xYTitleAnnotation.getY(),
                        xYTitleAnnotation.getMaxHeight(), xYTitleAnnotation.getMaxWidth());

                for (Map.Entry<String, Rectangle2D.Double> entry : insidePositionBinding.entrySet()) {
                    if (entry.getValue().equals(rect)) {
                        model.setSelectedItem(entry.getKey());
                        founded = true;
                        break;
                    }

                    CustomPositionCheckBox.setEnabled(false);
                    CustomPositionCheckBox.setSelected(false);
                }
                if (!founded) {
                    Helper.getHelper().changePanelState(CurrentPositionPanel, true);
                    CustomPositionCheckBox.setSelected(true);
                    CustomPositionCheckBox.setEnabled(true);
                    CustomPositionCheckBox.updateUI();
                    PosistionCheckBox.setEnabled(false);

                    X.setText(String.valueOf(rect.getX() * 100));
                    Y.setText(String.valueOf(rect.getY() * 100));
                    Width.setText(String.valueOf(rect.getWidth() * 100));
                    Height.setText(String.valueOf(rect.getHeight() * 100));
                }
            }
        } else {
            CustomPositionCheckBox.setEnabled(false);
            CustomPositionCheckBox.setSelected(false);
            Helper.getHelper().changePanelState(CurrentPositionPanel, false);

            fillModelWithValues(outsidePositionBindings, model);
            LegendTitle legendTitle = parentPanel.getChart().getLegend();
            for (Map.Entry<String, RectangleEdge> entry : outsidePositionBindings.entrySet()) {
                if (entry.getValue().equals(legendTitle.getPosition())) {
                    model.setSelectedItem(entry.getKey());
                    break;
                }
            }
        }
    }

    private void fillModelWithValues(Map<String, ?> values, DefaultComboBoxModel model) {
        for (String key : values.keySet()) {
            model.addElement(key);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        positionButtonGroup = new javax.swing.ButtonGroup();
        mainPanel = new javax.swing.JPanel();
        Size = new javax.swing.JPanel();
        PosistionCheckBox = new javax.swing.JComboBox();
        CurrentPositionPanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        X = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        Y = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        Width = new javax.swing.JTextField();
        Height = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        InsidePlotCheckBox = new javax.swing.JCheckBox();
        CustomPositionCheckBox = new javax.swing.JCheckBox();
        VisibleCheckBox = new javax.swing.JCheckBox();
        buttonPanel = new javax.swing.JPanel();
        OKButton = new javax.swing.JButton();
        Apply = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        Size.setBorder(javax.swing.BorderFactory.createTitledBorder("Position"));

        CurrentPositionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Custom position"));

        jLabel1.setText("x");

        jLabel2.setText("y");

        jLabel3.setText("width");

        jLabel4.setText("height");

        jLabel5.setText("%");

        jLabel6.setText("%");

        jLabel7.setText("%");

        jLabel8.setText("%");

        javax.swing.GroupLayout CurrentPositionPanelLayout = new javax.swing.GroupLayout(CurrentPositionPanel);
        CurrentPositionPanel.setLayout(CurrentPositionPanelLayout);
        CurrentPositionPanelLayout.setHorizontalGroup(
            CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CurrentPositionPanelLayout.createSequentialGroup()
                .addGroup(CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(CurrentPositionPanelLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(X, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(CurrentPositionPanelLayout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(Y, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8)
                    .addComponent(jLabel7))
                .addGap(18, 18, 18)
                .addGroup(CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(Height)
                    .addComponent(Width, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel5)
                    .addComponent(jLabel6))
                .addContainerGap())
        );
        CurrentPositionPanelLayout.setVerticalGroup(
            CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CurrentPositionPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(CurrentPositionPanelLayout.createSequentialGroup()
                        .addGroup(CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(Width, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(Height, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6)))
                    .addGroup(CurrentPositionPanelLayout.createSequentialGroup()
                        .addGroup(CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(X, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(CurrentPositionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(Y, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel8))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        InsidePlotCheckBox.setText("Inside Plot");
        InsidePlotCheckBox.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                InsidePlotCheckBoxMouseClicked(evt);
            }
        });

        CustomPositionCheckBox.setText("Enable Custom Position");
        CustomPositionCheckBox.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                CustomPositionCheckBoxMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout SizeLayout = new javax.swing.GroupLayout(Size);
        Size.setLayout(SizeLayout);
        SizeLayout.setHorizontalGroup(
            SizeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SizeLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(SizeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(CustomPositionCheckBox)
                    .addComponent(CurrentPositionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
            .addGroup(SizeLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(SizeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(InsidePlotCheckBox)
                    .addComponent(PosistionCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        SizeLayout.setVerticalGroup(
            SizeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SizeLayout.createSequentialGroup()
                .addComponent(InsidePlotCheckBox)
                .addGap(9, 9, 9)
                .addComponent(PosistionCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)
                .addComponent(CustomPositionCheckBox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(CurrentPositionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        VisibleCheckBox.setText("Visible");
        VisibleCheckBox.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                VisibleCheckBoxMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(VisibleCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(Size, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Size, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(VisibleCheckBox))
        );

        OKButton.setText("Close");
        OKButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                OKButtonMouseClicked(evt);
            }
        });
        buttonPanel.add(OKButton);

        Apply.setText("Apply");
        Apply.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                ApplyMouseClicked(evt);
            }
        });
        buttonPanel.add(Apply);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(mainPanel, javax.swing.GroupLayout.Alignment.LEADING, 0, 203, Short.MAX_VALUE)
                    .addComponent(buttonPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(mainPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void OKButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_OKButtonMouseClicked
        ApplyMouseClicked(evt);
        dispose();
    }//GEN-LAST:event_OKButtonMouseClicked

    private void ApplyMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ApplyMouseClicked
        try {

            if (!VisibleCheckBox.isSelected()) {
                annotationWrapper.setVisible(false);
                parentPanel.getChart().getLegend().setVisible(false);
                return;
            }

            if (InsidePlotCheckBox.isSelected()) {
                Rectangle.Double rect = null;
                if (CustomPositionCheckBox.isSelected()) {
                    double x = Double.parseDouble(X.getText());
                    double y = Double.parseDouble(Y.getText());
                    double width = Double.parseDouble(Width.getText());
                    double height = Double.parseDouble(Height.getText());
                    if (x > 100.0 || x < 0.0 || x > 100.0 || y < 0.0 || y > 100.0 || width < 0.0 || width > 100.0 || height < 0.0 || height > 100.0 || x < 0.0) {
                        throw new RuntimeException("One of custom parameter is grater than 100 or lesser than 0");
                    }
                    rect = new Rectangle.Double(x / 100.0, y / 100.0, width / 100.0, height / 100.0);
                } else {
                    String key = (String) PosistionCheckBox.getSelectedItem();
                    rect = insidePositionBinding.get(key);
                }
                annotationWrapper.setPosition(rect);

            } else {
                setOutsideLegendPosition();
            }
        } catch (NumberFormatException e) {
            throw new RuntimeException(e.getMessage());
        } catch (RuntimeException e) {
            JOptionPane.showMessageDialog(this, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_ApplyMouseClicked

    private void setOutsideLegendPosition() {
        String key = (String) PosistionCheckBox.getSelectedItem();
        RectangleEdge rect = outsidePositionBindings.get(key);
        LegendTitle legend = parentPanel.getChart().getLegend();
        legend.setPosition(rect);

    }

    private void InsidePlotCheckBoxMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_InsidePlotCheckBoxMouseClicked
        if (VisibleCheckBox.isSelected()) {
            updateComponentsRegardingInsidePlotSelection();
        }
    }//GEN-LAST:event_InsidePlotCheckBoxMouseClicked

    private void CustomPositionCheckBoxMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CustomPositionCheckBoxMouseClicked
        if (!CustomPositionCheckBox.isEnabled()) {
            return;
        }
        Helper.getHelper().changePanelState(CurrentPositionPanel, CustomPositionCheckBox.isSelected());
        PosistionCheckBox.setEnabled(!CustomPositionCheckBox.isSelected());
    }//GEN-LAST:event_CustomPositionCheckBoxMouseClicked

    private void VisibleCheckBoxMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_VisibleCheckBoxMouseClicked
        annotationWrapper.setVisible(VisibleCheckBox.isSelected() && InsidePlotCheckBox.isSelected());
        parentPanel.getChart().getLegend().setVisible(VisibleCheckBox.isSelected() && !InsidePlotCheckBox.isSelected());
    }//GEN-LAST:event_VisibleCheckBoxMouseClicked

    /*@Override
    public void dispose() {
        frameWithChart.setEnabled(true);
        super.dispose();
    }*/

 
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Apply;
    private javax.swing.JPanel CurrentPositionPanel;
    private javax.swing.JCheckBox CustomPositionCheckBox;
    private javax.swing.JTextField Height;
    private javax.swing.JCheckBox InsidePlotCheckBox;
    private javax.swing.JButton OKButton;
    private javax.swing.JComboBox PosistionCheckBox;
    private javax.swing.JPanel Size;
    private javax.swing.JCheckBox VisibleCheckBox;
    private javax.swing.JTextField Width;
    private javax.swing.JTextField X;
    private javax.swing.JTextField Y;
    private javax.swing.JPanel buttonPanel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel mainPanel;
    private javax.swing.ButtonGroup positionButtonGroup;
    // End of variables declaration//GEN-END:variables
}
